Move direction semantics from dispatches to conventions #125
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Dereferencing a pointer with
std::to_address()
is feasible, but throws away cv-ref qualifiers. It is acceptable in many cases, but has certain limitations comparing tostd::move_only_function
(C++23) andstd::copyable_function
(C++26). Therefore, we have made a major decision to switch fromstd::to_address()
tooperator*
when dereferencing a pointer that is potentially qualified. Consequently, we also decided to remove the direction semantics in reflection types (added in #121) because the result type ofoperator*
relies on the qualifier of a pointer.Changes
concept facade
.static constexpr bool is_direct
from dispatch types to convention types.proxy_invoke
from the combination of dispatch and overload types into one convention type.access_proxy
from an instantiation ofproxy
into one facade type.operator*
toproxy
.operator*
to the 3 pointer implementations:inplace_ptr
,allocated_ptr
andcompact_ptr
.facade_builder
:add_indirect_convention
andadd_direct_convention
. The existingadd_convention
is equivalent toadd_indirect_convention
.DIRECT
andINDIRECT
macros of dispatch definition introduced in Implement indirection syntax #121, specifically:PRO_DEF_INDIRECT_MEM_DISPATCH(__NAME, ...) PRO_DEF_DIRECT_MEM_DISPATCH(__NAME, ...) PRO_DEF_INDIRECT_FREE_DISPATCH(__NAME, ...) PRO_DEF_DIRECT_FREE_DISPATCH(__NAME, ...) PRO_DEF_INDIRECT_OPERATOR_DISPATCH(__NAME, ...) PRO_DEF_DIRECT_OPERATOR_DISPATCH(__NAME, ...) PRO_DEF_INDIRECT_PREFIX_OPERATOR_DISPATCH(__NAME, ...) PRO_DEF_DIRECT_PREFIX_OPERATOR_DISPATCH(__NAME, ...) PRO_DEF_INDIRECT_POSTFIX_OPERATOR_DISPATCH(__NAME, ...) PRO_DEF_DIRECT_POSTFIX_OPERATOR_DISPATCH(__NAME, ...) PRO_DEF_INDIRECT_CONVERSION_DISPATCH(__NAME, ...) PRO_DEF_DIRECT_CONVERSION_DISPATCH(__NAME, ...)